package world3d;

import world3d.sound.SoundManager;
import world3d.sound.Sounds;
import world3d.world.World;
import world3d.world.entities.*;

import javax.media.opengl.awt.GLCanvas;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class Main {
	private static World world;

	public static void main(String[] args){
		System.out.println("start");

		final GLCanvas canvas = new GLCanvas();
		final Frame frame = new Frame("Jogl Quad drawing");

		frame.add(canvas);
		frame.setSize(800, 600);
		frame.setResizable(true);
		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				world.dispose();
				frame.dispose();
				System.exit(0);
			}
		});
		frame.setVisible(true);
//		frame.setOpacity(.5f);
//		frame.(true);
		world = new World(canvas);
//		world.addEntity(new SphereEntity());
//		world.addEntity(new SphereEntity(0, 0, 0));
//		world.addEntity(new SphereEntity(0, 0, 1));
//		world.addEntity(new SphereEntity(0, 1, 0));
//		world.addEntity(new SphereEntity(2, 2, 2));
//		world.addEntity(new SphereEntity(0, 1, 1));
//		world.addEntity(new SphereEntity(1, 0, 0));
//		world.addEntity(new SphereEntity(1, 0, 1));
		world.addEntity(new SphereEntity(1, 1, 0));
//		world.addEntity(new SphereEntity(1, 1, 1));

		world.addEntity(new SphereOnXYEntity(0, 0, 0));
		world.addEntity(new SphereOnXYEntity(0, 0, 1));
		world.addEntity(new SphereOnXYEntity(0, 1, 0));
		world.addEntity(new SphereOnXYEntity(2, 2, 2));
		world.addEntity(new SphereOnXYEntity(0, 1, 1));
		world.addEntity(new SphereOnXYEntity(1, 0, 0));
		world.addEntity(new SphereOnXYEntity(1, 0, 1));
		world.addEntity(new SphereOnXYEntity(1, 1, 0));
		world.addEntity(new SphereOnXYEntity(1, 1, 1));
//		world.addEntity(new SphereOnXYEntity());
//		world.addEntity(new SphereOnXYEntity2());
//		world.addEntity(new GalaxyEntity());
//		world.addEntity(new LightEntity());
//		world.addEntity(new SkyAirEntity());
//		world.addEntity(new QuadsEntity());
		SoundManager.tryToPlay(Sounds.GALAXY_BG);
	}

}
